package com.example.oauth2.web;

import com.example.oauth2.util.APIResponse;
import com.example.oauth2.service.ClientService;
import com.example.oauth2.vo.ClientVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 客户端controller
 */
@RestController
public class ClientController {

    @Autowired
    private ClientService clientService;

    /**
     * 创建一个客户端
     * @param clientVO
     * @return
     */
    @PostMapping(value = "/client/create")
    public APIResponse addClient(@RequestBody ClientVO clientVO) {
        APIResponse apiResponse = new APIResponse();
        apiResponse.setResponseCode(APIResponse.OK);
        return clientService.addClient(clientVO);
    }


}
